/*
 * $Id: TaskTag.java,v 1.3 2009/05/08 16:34:25 afaichun Exp $
 * 
 * Copyright (C) 2008 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.onwatch.xml.tag;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

@XStreamAlias("task")
public class TaskTag {
	private final static String FAILURE = "Failure";
	private String status = null;
	private String description = null;
	@XStreamAsAttribute
	private Long id = null;
	
	public TaskTag() {}
	
	public TaskTag(Long id) {
		this.id = id;
	}
	
	public void setFailureStatus(String description) {
		status = FAILURE;
		this.description = description;
	}
	
	public String getStatus() {
		return status;
	}
	
	public String getDescription() {
		return description;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public void setId(String id) {
		if(id != null) {
			this.id = new Long(id);
		}
	}
	
	public String toString() {
		StringBuffer msg = new StringBuffer();
		msg.append(TaskTag.class.getName()).append(":\n");
		msg.append("{Id: ").append(getId()).append("},");
		msg.append("{status: ").append(getStatus()).append("},");
		msg.append("{description: ").append(getDescription()).append("}");
		msg.append("\n");
		return msg.toString();
	}
}
